<?php
/**************************************************************************/
/* SmartDB: smart & fast SQL constructor
/* ver. 0.1 dev build 001
/* ===========================
/*
/* Copyright (c)oded 2007-2009 by WP
/* http://code.google.com/p/smartdb/
/* 														
/* SmartDB.class.php: API class
/*
/* ATTENSION!!! IT'S ALPHA DEVEL VERSION! FOR TESTING PURPOSES ONLY.
/* PLEASE CHECK OUT ACTUAL VERSION AT http://smartdb.keeperweb.com
/**************************************************************************/
ini_set('zend.ze1_compatibility_mode','Off');
define('SMARTDB_DIR',dirname(__FILE__).DIRECTORY_SEPARATOR);
if (!function_exists('signedint'))
{
 function signedint($int)
 {
  $int = getint($int);
  return ($int > 0?'+':'').$int;
 }
}
if (!function_exists('getint'))
{
 function getint($var)
 {
  $var = strval($var);
  return (int) ctype_digit(substr($var,0,1) == '-'?substr($var,1):$var)?$var:0;
 }
}
function sqlescape($string)
{
 return SmartDB::$db->escape($string);
}
function sqlescape_full($string)
{
 return SmartDB::$db->like_escape($string);
}
class SmartDB
{
 static $db;
 public $driver = 'mysql5';
 public function __construct()
 {
 }
 public static function init($driver = NULL)
 {
  return include SMARTDB_DIR.'drivers/'.$driver.'.driver.php';
 }
}
class SmartDB_prototype
{
 public function __construct()
 {
  $this->qcache_path = SMARTDB_DIR.'qcache/';
  $this->resultcache_path = SMARTDB_DIR.'resultcache/';
  $this->db_connect_id = &$this->pointer;
  $this->dbname = &$this->database;
 }
}
class SmartDB_query_prototype
{
 public $driver;
 public function __construct()
 {
 }
}